<template>

      <date-picker   v-on:change="change" ref="datePicker" :date="time" :option="option" :limit="limit"></date-picker>

</template>
<style lang="scss" scoped>

</style>
<script>
  import Util from "util";

 import myDatepicker from './vue-datepicker-es6';


    export default{
      props : ['dateInputStyle','time','limit'],
      data(){
          return{
              option: {
                  type: 'day',
                  week: ['周一', '周二', '周三', '周四', '周五', '周六', '周日'],
                  month: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
                  format: 'YYYY-MM-DD',
                  placeholder: '',
                  inputStyle: this.dateInputStyle,
                  color: {
                    checked: '#42BD55',
                    checkedDay: '#42BD55',
                    header: '#42BD55',
                    headerText: '#fff'
                  },
                  buttons: {
                    ok: '确定',
                    cancel: '取消'
                  },

                overlayOpacity: 0.5, // 0.5 as default
                dismissible: true // as true as default
           }
        }
      },

      mounted : function(){
        console.log('time-->',this.time);
      },
     methods: {

        change : function(time){
           console.log("change");
           this.$emit("change",time);
        },
        complete  : function(){
          console.log("complete");
        },

        showCheck : function(){
          this.$refs.datePicker.showCheck();
        },

        hide : function(){
          this.isShow = false;
        },
        show   : function(){
         this.isShow = true;
        }

     },
        components:{
           'date-picker': myDatepicker
        }
    }
</script>
